package com.zf.springlearn.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Service
public class TestEventService {
    @Autowired
    private ApplicationEventPublisher publisher;

    @PostConstruct
    public void publish(){
        publisher.publishEvent(new TestEvent(new Object(),"test event"));
    }
}
